﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新建角色</title>
    <#include "/pages/include/head.ftl" />
	<#import "/pages/import/images.ftl" as img />
</head>
<body>
<div class="page-top-bar">
<ul class="path">权限管理<span>&gt;</span><a href="javascript:void(0)" onclick="goBack(true);">角色管理</a><span>&gt;</span>新建角色</ul>
  <ul class="page-control">
    <li><a href="javascript:void(0)" onfocus="this.blur()"><img src="${contextPath}/images/ico16/ico-back.gif" alt="" /><span onclick="goBack(true); ">返回</span></a></li>
  </ul>
</div>
<div class="function-bar">
  <ul class="business-info">
  </ul>
  <ul class="form-function">
  </ul>
</div>
<div class="form-container">
<div class="form-title"><span class="form-title-into">新建角色</span></div>
  <@s.fielderror />
  <@s.actionerror/>
  <ul id="formerrors" class="errorMessage"></ul> 
  
  <@s.form id="saveform" name="saveform" action="">
  <table cellspacing="1" cellpadding="0" class="form-2column form-margin">
  
  <tr>
      <th>角色名称：</th>
      <td class="from-require"><input type="text" name="role.name" value="" class="input-common input-word-20" dataType="Require" msg="请填写角色名称" autocomplete="off" /></td>
    </tr>

    <tr>
      <th>业务系统：</th>
      <td class="from-require"><select id="" name="" class="select-word-10">
          <option>全部</option>
        </select></td>
    </tr>
    
     <tr>
      <th>备注：</th>
      <td><textarea name="role.description" cols="50" rows="5"></textarea></td>
    </tr>
  </table>
 </@s.form>
<div class="form-title"></div>
  <div class="main-form-btn">
    <div class="btn-order" onclick="postdata(false);">
      <ul>
        <li class="left-normal" id="btn1_31"></li>
        <li class="middle-normal" id="btn1_32" onmouseover="btn_change_over(3)" onmouseout="btn_change_out(3)" onblur="btn_change(3)"><img src="${contextPath}/images/ico16/ico-saveAdd.gif" alt="" />保存并新建</li>
        <li class="right-normal" id="btn1_33"></li>
      </ul>
    </div>
    <div class="btn-order" onclick="postdata(true);">
      <ul>
        <li class="left-normal" id="btn1_11"></li>
        <li class="middle-normal" id="btn1_12" onmouseover="btn_change_over(1)" onmouseout="btn_change_out(1)" onblur="btn_change(1)"><img src="${contextPath}/images/ico16/ico-save.gif" alt="" />保 存</li>
        <li class="right-normal" id="btn1_13"></li>
      </ul>
    </div>
    <div class="btn-order" onclick="goBack(true)">
      <ul>
        <li class="left-normal" id="btn1_21"></li>
        <li class="middle-normal" id="btn1_22" onmouseover="btn_change_over(2)" onmouseout="btn_change_out(2)" onblur="btn_change(2)"><img src="${contextPath}/images/ico16/ico-back.gif" alt="" />返 回</li>
        <li class="right-normal" id="btn1_23"></li>
      </ul>
    </div>
  </div>
</div>

<script>
     function goBack(onlyBack){
       var url = onlyBack?"list.action":"add.action";
       window.open(url,"main","");  
     }
	  function postdata(onlyBack){  

      var form = document.forms['saveform'];
      var legal = Validator.Validate(form,3);

     if(legal){
       $.ajax({                                                
         type: "POST",                                     
         url: "save.action",                                   
         data: $("#saveform").formToArray(),   
         success: function(msg){
            goBack(onlyBack);        
        } 
     }); 
     }
    }
</script>
</body>
</html>
